<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>个人信息</span>
      <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
    </div>
    <div  class="text item">
      {{'姓名： ' + temp.realName }}
    </div>
    <div  class="text item">
      {{'性别： ' + temp.gender }}
    </div>
    <div  class="text item">
      {{'年龄： ' + temp.age }}
    </div>
    <div  class="text item" v-if="temp.roleId!=8">
      {{'职位： ' + temp.roleName }}
    </div>
    <div  class="text item" v-if="temp.roleId!=8">
      {{'科室： ' + temp.name }}
    </div>
    <div  class="text item">
      {{'电话： ' + temp.telephone }}
    </div>
  </el-card>
</template>

<script>
  import { getUserMsg } from '@/api/user'
    export default {
        name: "personalCenter",
      data (){
        return {
          temp: {
            roleId:'',
            // account: '',
            realName: '',
            gender: '',
            age: '',
            roleName: '',
            name: '',
            telephone: ''
          }
        }
      },
      methods:{
        getUser(){
          getUserMsg().then(res=>{
            this.temp=res.content
          }).catch(err => {
            console.log(err)
          })
        }
      },
      mounted() {
        this.getUser()
      }
    }
</script>

<style scoped>
  .text {
    font-size: 14px;
  }

  .item {
    margin-bottom: 18px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }

  .box-card {
    width: 480px;
  }

</style>
